<!doctype html>

<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>genericfontnames_test.js (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>

<div class="clear"></div>

<h2><a href="local_closure_goog_locale_genericfontnames_test.js.html">genericfontnames_test.js</a></h2>

<pre class="prettyprint lang-js">
<a name="line1"></a>// Copyright 2008 The Closure Library Authors. All Rights Reserved.
<a name="line2"></a>//
<a name="line3"></a>// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<a name="line4"></a>// you may not use this file except in compliance with the License.
<a name="line5"></a>// You may obtain a copy of the License at
<a name="line6"></a>//
<a name="line7"></a>//      http://www.apache.org/licenses/LICENSE-2.0
<a name="line8"></a>//
<a name="line9"></a>// Unless required by applicable law or agreed to in writing, software
<a name="line10"></a>// distributed under the License is distributed on an &quot;AS-IS&quot; BASIS,
<a name="line11"></a>// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<a name="line12"></a>// See the License for the specific language governing permissions and
<a name="line13"></a>// limitations under the License.
<a name="line14"></a>
<a name="line15"></a>goog.provide(&#39;goog.locale.genericFontNamesTest&#39;);
<a name="line16"></a>goog.setTestOnly(&#39;goog.locale.genericFontNamesTest&#39;);
<a name="line17"></a>
<a name="line18"></a>goog.require(&#39;goog.locale.genericFontNames&#39;);
<a name="line19"></a>goog.require(&#39;goog.testing.jsunit&#39;);
<a name="line20"></a>
<a name="line21"></a>goog.locale.genericFontNames.data_[&#39;zh_TW&#39;] = [
<a name="line22"></a>  {
<a name="line23"></a>    &#39;caption&#39;: &#39;\u5fae\u8edf\u6b63\u9ed1\u9ad4&#39;,
<a name="line24"></a>    &#39;value&#39;: &#39;Microsoft JhengHei,\u5fae\u8edf\u6b63\u9ed1\u9ad4,SimHei,&#39; +
<a name="line25"></a>        &#39;\u9ed1\u4f53,MS Hei,STHeiti,\u534e\u6587\u9ed1\u4f53,Apple &#39; +
<a name="line26"></a>        &#39;LiGothic Medium,\u860b\u679c\u5137\u4e2d\u9ed1,LiHei Pro Medium,&#39; +
<a name="line27"></a>        &#39;\u5137\u9ed1 Pro,STHeiti Light,\u534e\u6587\u7ec6\u9ed1,AR PL &#39; +
<a name="line28"></a>        &#39;ZenKai Uni,\u6587\u9f0ePL\u4e2d\u6977Uni,FreeSans,sans-serif&#39;
<a name="line29"></a>  },
<a name="line30"></a>  {
<a name="line31"></a>    &#39;caption&#39;: &#39;\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53&#39;,
<a name="line32"></a>    &#39;value&#39;: &#39;Microsoft YaHei,\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53,FreeSans,&#39; +
<a name="line33"></a>        &#39;sans-serif&#39;
<a name="line34"></a>  },
<a name="line35"></a>  {
<a name="line36"></a>    &#39;caption&#39;: &#39;\u65b0\u7d30\u660e\u9ad4&#39;,
<a name="line37"></a>    &#39;value&#39;: &#39;SimSun,\u5b8b\u4f53,MS Song,STSong,\u534e\u6587\u5b8b\u4f53,&#39; +
<a name="line38"></a>        &#39;Apple LiSung Light,\u860b\u679c\u5137\u7d30\u5b8b,LiSong Pro Light,&#39; +
<a name="line39"></a>        &#39;\u5137\u5b8b Pro,STFangSong,\u534e\u6587\u4eff\u5b8b,AR PL &#39; +
<a name="line40"></a>        &#39;ShanHeiSun Uni,\u6587\u9f0eP&#39; +
<a name="line41"></a>        &#39;L\u7ec6\u4e0a\u6d77\u5b8bUni,AR PL New Sung,\u6587\u9f0e PL \u65b0&#39; +
<a name="line42"></a>        &#39;\u5b8b,FreeSerif,serif&#39;
<a name="line43"></a>  },
<a name="line44"></a>  {
<a name="line45"></a>    &#39;caption&#39;: &#39;\u7d30\u660e\u9ad4&#39;,
<a name="line46"></a>    &#39;value&#39;: &#39;NSimsun,\u65b0\u5b8b\u4f53,FreeMono,monospace&#39;
<a name="line47"></a>  }
<a name="line48"></a>];
<a name="line49"></a>
<a name="line50"></a>function testNormalize() {
<a name="line51"></a>  var result = goog.locale.genericFontNames.normalize_(&#39;zh&#39;);
<a name="line52"></a>  assertEquals(&#39;zh&#39;, result);
<a name="line53"></a>  var result = goog.locale.genericFontNames.normalize_(&#39;zh-hant&#39;);
<a name="line54"></a>  assertEquals(&#39;zh_Hant&#39;, result);
<a name="line55"></a>  var result = goog.locale.genericFontNames.normalize_(&#39;zh-hant-tw&#39;);
<a name="line56"></a>  assertEquals(&#39;zh_Hant_TW&#39;, result);
<a name="line57"></a>}
<a name="line58"></a>
<a name="line59"></a>function testInvalid() {
<a name="line60"></a>  var result = goog.locale.genericFontNames.getList(&#39;invalid&#39;);
<a name="line61"></a>  assertArrayEquals([], result);
<a name="line62"></a>}
<a name="line63"></a>
<a name="line64"></a>function testZhHant() {
<a name="line65"></a>  var result = goog.locale.genericFontNames.getList(&#39;zh-tw&#39;);
<a name="line66"></a>  assertObjectEquals([
<a name="line67"></a>    {
<a name="line68"></a>      &#39;caption&#39;: &#39;\u5fae\u8edf\u6b63\u9ed1\u9ad4&#39;,
<a name="line69"></a>      &#39;value&#39;: &#39;Microsoft JhengHei,\u5fae\u8edf\u6b63\u9ed1\u9ad4,SimHei,&#39; +
<a name="line70"></a>          &#39;\u9ed1\u4f53,MS Hei,STHeiti,\u534e\u6587\u9ed1\u4f53,Apple &#39; +
<a name="line71"></a>          &#39;LiGothic Medium,\u860b\u679c\u5137\u4e2d\u9ed1,LiHei Pro Medium,&#39; +
<a name="line72"></a>          &#39;\u5137\u9ed1 Pro,STHeiti Light,\u534e\u6587\u7ec6\u9ed1,AR PL &#39; +
<a name="line73"></a>          &#39;ZenKai Uni,\u6587\u9f0ePL\u4e2d\u6977Uni,FreeSans,sans-serif&#39;
<a name="line74"></a>    },
<a name="line75"></a>    {
<a name="line76"></a>      &#39;caption&#39;: &#39;\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53&#39;,
<a name="line77"></a>      &#39;value&#39;: &#39;Microsoft YaHei,\u5fae\u8f6f\u96c5\u9ed1\u5b57\u4f53,&#39; +
<a name="line78"></a>          &#39;FreeSans,sans-serif&#39;
<a name="line79"></a>    },
<a name="line80"></a>    {
<a name="line81"></a>      &#39;caption&#39;: &#39;\u65b0\u7d30\u660e\u9ad4&#39;,
<a name="line82"></a>      &#39;value&#39;: &#39;SimSun,\u5b8b\u4f53,MS Song,STSong,\u534e\u6587\u5b8b\u4f53,&#39; +
<a name="line83"></a>          &#39;Apple LiSung Light,\u860b\u679c\u5137\u7d30\u5b8b,LiSong Pro &#39; +
<a name="line84"></a>          &#39;Light,\u5137\u5b8b Pro,STFangSong,\u534e\u6587\u4eff\u5b8b,AR PL &#39; +
<a name="line85"></a>          &#39;ShanHeiSun Uni,\u6587\u9f0ePL\u7ec6\u4e0a\u6d77\u5b8bUni,AR PL New&#39; +
<a name="line86"></a>          &#39; Sung,\u6587\u9f0e PL \u65b0\u5b8b,FreeSerif,serif&#39;
<a name="line87"></a>    },
<a name="line88"></a>    {
<a name="line89"></a>      &#39;caption&#39;: &#39;\u7d30\u660e\u9ad4&#39;,
<a name="line90"></a>      &#39;value&#39;: &#39;NSimsun,\u65b0\u5b8b\u4f53,FreeMono,monospace&#39;
<a name="line91"></a>    }],
<a name="line92"></a>  result);
<a name="line93"></a>}
</pre>


</body>
</html>
